SDL_CFLAGS := $(shell sdl-config --cflags)
SDL_LDFLAGS := $(shell sdl-config --libs)
OBJECTS := adventure.o character.o CLI.o tree.o item.o mapitem.o itemfactory.o mapitemfactory.o location.o sdlevent.o sdlgui.o sdlmenu.o sdlbutton.o sdlmap.o game.o sdltext.o sdltimer.o astar.o astarque.o node.o inventorywindow.o gamemenu.o

CC = g++ -g
name = adventure2
version = 0.2a

adventure : ${OBJECTS}
	$(CC) -I /usr/include/boost $(SDL_CFLAGS) -o ../$(name)-$(version) $(OBJECTS) $(SDL_LDFLAGS) -lSDL_image -lSDL_ttf -lboost_serialization

adventure.o : adventure.cc
	$(CC) -c $(SDL_CFLAGS) adventure.cc

character.o : character.cc character.h
	$(CC) -c $(SDL_CFLAGS) -I /usr/include/boost character.cc

CLI.o : CLI.cc CLI.h
	$(CC) -c $(SDL_CFLAGS) CLI.cc

tree.o : tree.cc tree.h
	$(CC) -c $(SDL_CFLAGS) -I /usr/include/boost/ tree.cc

item.o : item.cpp item.h
	$(CC) -I /usr/include/boost/ -c item.cpp

mapitem.o : mapitem.cpp mapitem.h
	$(CC) -I /usr/include/boost/ -c mapitem.cpp

location.o : location.cpp location.h
	    $(CC) -c $(SDL_CFLAGS) -I /usr/include/boost/ location.cpp

sdlevent.o : sdlevent.cpp sdlevent.h
	    $(CC) -c $(SDL_CFLAGS) sdlevent.cpp

sdlgui.o : sdlgui.cpp sdlgui.h
	  $(CC) -c $(SDL_CFLAGS) sdlgui.cpp

sdlmenu.o : sdlmenu.cpp sdlmenu.h
	   $(CC) -c $(SDL_CFLAGS) sdlmenu.cpp

sdlbutton.o : sdlbutton.cpp sdlbutton.h
	     $(CC) -c $(SDL_CFLAGS) sdlbutton.cpp

sdlmap.o : sdlmap.cpp sdlmap.h
	  $(CC) -c  $(SDL_CFLAGS) sdlmap.cpp

game.o : game.cpp game.h
	$(CC) -c $(SDL_CFLAGS) game.cpp

sdltext.o : sdltext.cpp sdltext.h
	$(CC) -c $(SDL_CFLAGS) sdltext.cpp

sdltimer.o : sdltimer.cpp sdltimer.h
	$(CC) -c $(SDL_CFLAGS) sdltimer.cpp

itemfactory.o : itemfactory.cpp itemfactory.h
		$(CC) -c itemfactory.cpp

mapitemfactory.o : mapitemfactory.cpp mapitemfactory.h
		$(CC) -c mapitemfactory.cpp

astar.o : astar.cpp astar.h
		$(CC) -c astar.cpp

astarque.o : astarque.cpp astarque.h
		$(CC) -c astarque.cpp

node.o : node.cpp node.h
	$(CC) -c node.cpp

inventorywindow.o : inventorywindow.cpp inventorywindow.h
		$(CC) -c $(SDL_CFLAGS) inventorywindow.cpp

gamemenu.o : gamemenu.cpp gamemenu.h
	$(CC) -c $(SDL_CFLAGS) gamemenu.cpp

clean :
	rm -Rf ../$(name)-$(version) $(OBJECTS)
